/*
 * @Author: zoufengfan
 * @Date: 2022-01-10 14:29:04
 * @LastEditTime: 2022-01-10 16:12:25
 * @LastEditors: zoufengfan
 * 注册微应用
 */
import { registerApplication, start } from "single-spa";

// 创建微应用写法1
registerApplication(
  "@single-spa/welcome", //随便命名
  () =>
    System.import(
      "https://unpkg.com/single-spa-welcome/dist/single-spa-welcome.js" //单页应用的地址
    ),
  (location) => location.pathname === "/" //满足条件的路由地址
);

// 创建微应用写法2
registerApplication({
  name: "@Bteam/app111",
  app: () => System.import("@Bteam/app1"), //这里的地址为ejs上imports的配置key（本地地址）
  activeWhen: ["/app1"], //路由地址
});

start({
  urlRerouteOnly: true,
});
